package com.wangshouyu.mp.pay.unified;

import java.io.Serializable;
import java.security.PrivateKey;
import java.util.Objects;

/**
 * @author 王守钰
 * @date 2020年12月19日 21:06
 * @description 微信支付订单请求
 */
public class OrderRequest implements Serializable {

    /**
     * h5应用id
     */
    private String h5DeviceId;

    /**
     * h5应用名称
     */
    private String h5AppName;

    /**
     * h5 app地址
     */
    private String h5AppUrl;

    /**
     * 订单金额
     */
    private int amount;

    /**
     * 订单描述
     */
    private String orderDescription;

    /**
     * 订单编号
     */
    private String orderNo;

    /**
     * 通知地址
     */
    private String notifyUrl;

    /**
     * 客户端ip
     */
    private String clientIp;

    /**
     * 平台id
     */
    private String appId;

    /**
     * openId
     */
    private String openId;

    /**
     * 商户id
     */
    private String mchId;

    /**
     * 商户证书序列号
     */
    private String mchSerialNo;

    /**
     * 私钥
     */
    private PrivateKey privateKey;

    public String getH5DeviceId() {
        return h5DeviceId;
    }

    public void setH5DeviceId(String h5DeviceId) {
        this.h5DeviceId = h5DeviceId;
    }

    public String getH5AppName() {
        return h5AppName;
    }

    public void setH5AppName(String h5AppName) {
        this.h5AppName = h5AppName;
    }

    public String getH5AppUrl() {
        return h5AppUrl;
    }

    public void setH5AppUrl(String h5AppUrl) {
        this.h5AppUrl = h5AppUrl;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public String getOrderDescription() {
        return orderDescription;
    }

    public void setOrderDescription(String orderDescription) {
        this.orderDescription = orderDescription;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getMchSerialNo() {
        return mchSerialNo;
    }

    public void setMchSerialNo(String mchSerialNo) {
        this.mchSerialNo = mchSerialNo;
    }

    public PrivateKey getPrivateKey() {
        return privateKey;
    }

    public void setPrivateKey(PrivateKey privateKey) {
        this.privateKey = privateKey;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrderRequest that = (OrderRequest) o;
        return amount == that.amount && Objects.equals(h5DeviceId, that.h5DeviceId) && Objects.equals(h5AppName, that.h5AppName) && Objects.equals(h5AppUrl, that.h5AppUrl) && Objects.equals(orderDescription, that.orderDescription) && Objects.equals(orderNo, that.orderNo) && Objects.equals(notifyUrl, that.notifyUrl) && Objects.equals(clientIp, that.clientIp) && Objects.equals(appId, that.appId) && Objects.equals(openId, that.openId) && Objects.equals(mchId, that.mchId) && Objects.equals(mchSerialNo, that.mchSerialNo) && Objects.equals(privateKey, that.privateKey);
    }

    @Override
    public int hashCode() {
        return Objects.hash(h5DeviceId, h5AppName, h5AppUrl, amount, orderDescription, orderNo, notifyUrl, clientIp, appId, openId, mchId, mchSerialNo, privateKey);
    }

    @Override
    public String toString() {
        return "OrderRequest{" +
                "h5DeviceId='" + h5DeviceId + '\'' +
                ", h5AppName='" + h5AppName + '\'' +
                ", h5AppUrl='" + h5AppUrl + '\'' +
                ", amount=" + amount +
                ", orderDescription='" + orderDescription + '\'' +
                ", orderNo='" + orderNo + '\'' +
                ", notifyUrl='" + notifyUrl + '\'' +
                ", clientIp='" + clientIp + '\'' +
                ", appId='" + appId + '\'' +
                ", openId='" + openId + '\'' +
                ", mchId='" + mchId + '\'' +
                ", mchSerialNo='" + mchSerialNo + '\'' +
                ", privateKey=" + privateKey +
                '}';
    }
}
